function [p, price_matrix] = eur_put(S0, mu, sigma, K, T, N, M)
price_matrix = zeros(N + 1, M);
for i = 1 : M
    price_matrix(:, i) = underlyingpath(S0, mu, sigma, T, N);
end
payoff_euro =  max(K - price_matrix(end, :), 0);
p = mean(payoff_euro) * exp(-mu * T);
end